Repository navigation
Fixed signing in to mailboxes with characters beyond ASCII in the username or password - #1224
Merged
SommerEngineering merged 16 commits intoNov 24, 2026
Merged
Conversation
added 4 commits
November 23, 2026 14:22
Many users of AI Studio write German, and a mailbox password with an umlaut failed to sign in at Exchange because the encoding was never considered. Agents now keep the German special characters in mind wherever text leaves or enters the app as bytes: the encoding the other side expects, the Unicode normalization, and tests with such characters.
A mailbox now stores how its username and password are encoded when signing in: UTF-8, as before, or Windows-1252, which Microsoft Exchange expects. Mailboxes stored earlier load with UTF-8, and an encoding this version does not know keeps the mailbox from signing in at all. Windows-1252 goes through the SASL mechanism PLAIN only: MailKit sends the LOGIN command in UTF-8, whatever encoding it is handed. A username or password the encoding lacks a character of is never sent in it, and Windows-1252 composes a decomposed umlaut first. Nothing changes yet for existing mailboxes; the connection test which finds the encoding follows in the next commit.
…assword Microsoft Exchange expects the username and the password in Windows-1252, while AI Studio always sent UTF-8. A password with an umlaut, ß, §, or € was therefore refused. The connection test, which the user starts, may now try the other encoding once more when the server refused the first one, but only when the username or the password holds a character beyond ASCII. The encoding the server accepted is stored with the mailbox. A refused sign-in on record is cleared once the mailbox is saved with the new encoding. The synchronization, a manual retry, and creating a folder still sign in exactly once, with the stored encoding.
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some users could not sign in to their mailbox because their password contained a character beyond ASCII, in this case a German umlaut, and AI Studio reported a wrong password. MailKit sends usernames and passwords in UTF-8, but depending on its configuration, a mail server may expect another encoding. Microsoft Exchange, for example, may decode them with the code page of its Windows system:
windows-1252in Western Europe,windows-1250in Central Europe,windows-1251for Cyrillic,windows-1254in Turkey, orshift_jisin Japan.What changes:
utf-8by default. Users choose it in the server details of the mailbox dialog, under "Encoding of username and password". AI Studio offers every encoding .NET knows which keeps ASCII as it is, and stores its name, such aswindows-1254. UTF-16 and UTF-32 are left out because SASL PLAIN separates its parts with null bytes; UTF-8 already covers every Unicode character, Chinese, Japanese, and Korean included.PasswordEncodingfor an entry ofMAILBOX_PROVIDERS.MailServerPolicyapplies it to every connection to that server, the synchronization and mailboxes added before included, and the dialog shows it read-only.şorẞinwindows-1252, or when it is not UTF-8 and the server offers no PLAIN, AI Studio sends nothing and says why (new failureUNSUITABLE_ENCODING). For encodings other than UTF-8, the text is normalized to NFC first, so a decomposedä, e.g., from a password manager, still fitswindows-1252.AGENTS.mdgets the rule "Text beyond ASCII", for every language and script.The first version of this pull request knew only
UTF8andWINDOWS_1252. Configuration plugins now name the encoding as .NET does, e.g.,utf-8orwindows-1252. The old names are invalid and leave the entry out; since no release contained them, there is no compatibility for them.Related proposal or issue
None. Users reported the bug directly.
How did you test it?
dotnet run -- verify: 7,211 .NET tests, the trim smoke test, 379 Rust tests, Clippy, and the model sources.SaslMechanismPlainfor characters of several scripts and code pages, exactly one sign-in attempt, nothing sent for an unsuitable encoding, the encoding of the organization, the suggestion per language, and the encryption of such passwords in C# and Rust.Wiki
Users, page "Mailboxes" (German: "Postfächer"), new section "Characters beyond ASCII in the username or password", requires AI Studio v26.11.2 or newer: which encoding a mail server may expect, where to choose it, the button "Test again with …" after a rejected sign-in, why AI Studio never tries another encoding on its own, and when it sends nothing. Not for the well-known providers in the list of the dialog, such as Gmail or mailbox.org, also when users enter their host themselves.
IT departments, page "Confidence and Data Security", row
CONFIG["MAILBOX_PROVIDERS"]: the optional fieldPasswordEncodingwith examples such aswindows-1252,windows-1254, orshift_jis. Every mailbox on that server signs in with it, also one added before, and users can't change it. An invalid name leaves out the entry as a whole.Both are prepared for the release.
Required statements
Credits (optional)